package lab02.test11;

public class Rectangle implements Printx {
    @Override
    public void printMyWay() {
        System.out.println(length+","+width);
        //直接调用函数以此输出值
        System.out.println(area());
        System.out.println(perimeter());
    }
    float area(){
        return length*width;
    }
    float perimeter(){
        return 2*(length+width);
    }
    //属性：矩形的长、宽
   float length;
    float width;

}
